//
//  BreckImageVCViewController.m
//  AFN断点下载
//
//  Created by 崔博 on 2018/7/27.
//  Copyright © 2018年 崔博. All rights reserved.
//

#import "BreckImageVCViewController.h"

@interface BreckImageVCViewController ()<NSURLSessionDelegate,NSURLSessionDataDelegate>

@end

@implementation BreckImageVCViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"断点下载";
}
 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    
}

- (void)netLoadImage
{
    NSURL * url = [NSURL URLWithString:@""];
    NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL:url];
    NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:nil];
    NSURLSessionTask *task = [session dataTaskWithRequest:request];
    [task resume];
}
// 1 响应头
- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler
{
    
}
// 2 数据接收
- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data
{
    
}
// 3 完成
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
{
    
}
@end
